package com.dmlll.service.impl;

import com.dmlll.VO.ZjyangDTOzjy;
import com.dmlll.VO.ZjyangVO;
import com.dmlll.domain.DrugCategory;
import com.dmlll.mapper.DrugCategoryMapper;
import com.dmlll.service.DrugCategoryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author dmLll
 * @since 2021-03-31
 */
@Service
public class DrugCategoryServiceImpl extends ServiceImpl<DrugCategoryMapper, DrugCategory> implements DrugCategoryService {
    @Autowired
    private DrugCategoryMapper drugCategoryMapper;

    @Override
    public List<DrugCategory> selectCategory() { return drugCategoryMapper.selectCategory();
    }

    @Override
    public PageInfo <ZjyangVO> zjyangVO(ZjyangDTOzjy zjyangDTOzjy, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List <ZjyangVO> zjyangVOS = drugCategoryMapper.zjyangVO(zjyangDTOzjy);
        PageInfo<ZjyangVO> pageInfo = new PageInfo <>(zjyangVOS);
        return pageInfo;
    }
}
